<template>
<div>
  <h3>{{msg}}</h3>
  <form action="">
    账号：<input v-model="admin.username" type="text"><br/>
    密码：<input v-model="admin.password" type="text"><br/>
    <input type="button" value="登录" @click="login">
    <input type="button" value="重填"><br/>
  </form>
</div>
</template>

<script>
export default {
  name: "login",
  data(){
    return{
      msg:"用户登录",
      admin:{}
    };
  },
  methods:{
    login(){//登录按钮的功能
      console.log("in login ...");
      console.log(this.admin);
      //发布异步请求，检查 账号密码
      //axios.post("url",this.admin).then(res=>);
      //到主页显示
      this.$router.push({name: "index"});
    }
  }
}
</script>

<style scoped>

</style>
